import { markRaw } from 'vue'

import Layout from '../views/Layout/Layout.vue'

/**
 * 避免浪费性能
 * 不会转为 proxy 对象，返回本身对象
 * 不是响应式对象
 * , roles: [374]
 */
const Layouts = markRaw(Layout)

export default [{
  path: '',
  component: Layouts,
  redirect: 'index',
  meta: {
    title: '首页'
  },
  children: [{
    path: 'index',
    component: () => import('../views/Home/index.vue'),
    name: 'index',
    meta: {
      title: '首页',
      icon: 'icon-51'
    }
  }]
},
{
  path: '/System',
  component: Layouts,
  redirect: 'userManage',
  meta: {
    title: '系统管理'
  },
  children: [{
    path: 'userManage',
    component: () => import('../views/System/userManage.vue'),
    name: 'userManage',
    meta: {
      title: '用户管理',
      icon: 'icon-51'
    }
  },
  {
    path: 'roleManage',
    component: () => import('../views/System/roleManage.vue'),
    name: 'roleManage',
    meta: {
      title: '角色管理',
      icon: 'icon-51'
    }
  },
  {
    path: 'moduleManage',
    component: () => import('../views/System/moduleManage.vue'),
    name: 'moduleManage',
    meta: {
      title: '模块管理',
      icon: 'icon-51'
    }
  }
  ]
},
{
  path: '/LandingPage',
  component: Layouts,
  redirect: 'pageList',
  meta: {
    title: '落地页管理'
  },
  children: [{
    path: 'pageList',
    component: () => import('../views/LandingPage/pageList.vue'),
    name: 'pageList',
    meta: {
      title: '落地页数据',
      icon: 'icon-51'
    }
  }]
},
{
  path: '/MultiMediaMage',
  component: Layouts,
  redirect: 'pageVideo',
  meta: {
    title: '多媒体模块'
  },
  children: [{
    path: 'pageVideo',
    component: () => import('../views/MultiMediaMage/pageVideo.vue'),
    name: 'pageVideo',
    meta: {
      title: '视频组件',
      icon: 'icon-51'
    }
  },
  {
    path: 'pageAudio',
    component: () => import('../views/MultiMediaMage/pageAudio.vue'),
    name: 'pageAudio',
    meta: {
      title: '音频组件',
      icon: 'icon-51'
    }
  },
  {
    path: 'pageMaps',
    component: () => import('../views/MultiMediaMage/pageMaps.vue'),
    name: 'pageMaps',
    meta: {
      title: '地图组件',
      icon: 'icon-51'
    }
  }
  ]
},
{
  path: '/EChartsMage',
  component: Layouts,
  redirect: 'pieChart',
  meta: {
    title: 'ECharts 模块'
  },
  children: [{
    path: 'pieChart',
    component: () => import('../views/EChartsMage/pieChart.vue'),
    name: 'pieChart',
    meta: {
      title: '饼图组件',
      icon: 'icon-51'
    }
  },
  {
    path: 'radarChart',
    component: () => import('../views/EChartsMage/radarChart.vue'),
    name: 'radarChart',
    meta: {
      title: '雷达图组件',
      icon: 'icon-51'
    }
  }
  ]
},
{
  path: '/EditorMage',
  component: Layouts,
  redirect: 'wangEditor',
  meta: {
    title: '富文本模块'
  },
  children: [{
    path: 'wangEditor',
    component: () => import('../views/EditorMage/wangEditor.vue'),
    name: 'wangEditor',
    meta: {
      title: '富文本组件',
      icon: 'icon-51'
    }
  }]
},
{
  path: '/table',
  component: Layouts,
  redirect: 'table',
  meta: {
    title: '列表'
  },
  children: [{
    path: 'table',
    component: () => import('../views/Table/table.vue'),
    name: 'table',
    meta: {
      title: '列表1',
      icon: 'icon-51'
    }
  },
  {
    path: 'table1',
    component: () => import('../views/Table/table.vue'),
    name: 'table1',
    meta: {
      title: '列表2',
      icon: 'icon-51'
    }
  }
  ]
}
]
